<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/11/2
  Time: 19:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<% String path = request.getContextPath();%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <script>/*@cc_on window.location.href="http://support.dmeng.net/upgrade-your-browser.html?referrer="+encodeURIComponent(window.location.href); @*/</script>
    <title></title>
    <link type="text/css" rel="stylesheet" href="/heatconfig/css/style.css" />
    <script src="/heatconfig/js/jquery-3.5.1.min.js"></script>
    <script src="/heatconfig/js/address.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.gwccheck').click(function(){
                if($(this).attr("class")=="gwccheck on"){
                   // $(this).removeClass('on');
                }else{
                    $('.gwccheck').removeClass('on')
                    $(this).addClass('on');
                    $(".w100").children().remove();
                    $(this).parent().parent().parent().parent().next().append(" <img src=\"/heatconfig/images/address/addressline.png\" />")


                }
            })
        })
    </script>
</head>

<body>
<div class="headerbox">
    <div class="header">
        <div class="headerL">
            <a onclick="javascript:history.back(-1)" class="goback"><img src="/heatconfig/images/address/goback.png" /></a>
        </div>
        <div class="headerC">
            <p>管理地址</p>
        </div>
        <div class="headerR">
            <a href="/user/personalCenter/address/addressAdd">添加</a>
        </div>
    </div>
</div>
<div class="clear"></div>
<div class="hbox"></div>
<div class="addressbox on">
<%--    <div class="addressbox_1">--%>
<%--        <p class="p1">收货人：王小萌<span>186********</span></p>--%>
<%--        <p class="p2">陕西省西安市雁塔区二环南路中段绿地乐和城3号楼 </p>--%>
<%--    </div>--%>
<%--    <div class="addressbox_2">--%>
<%--        <div class="ad1">--%>
<%--            <div class="ad1_1">--%>
<%--                <div class="gwccheck on"></div>--%>
<%--            </div>--%>
<%--            <div class="ad1_2">设为默认</div>--%>
<%--        </div>--%>
<%--        <div class="ad2">--%>
<%--            <div class="ad2_1"><img src="/heatconfig/images/address/del.png"/></div>--%>
<%--            <div class="ad2_2">删除</div>--%>
<%--        </div>--%>
<%--        <div class="ad2 mr">--%>
<%--            <a href="addressEdit.html">--%>
<%--                <div class="ad2_1"><img src="/heatconfig/images/address/edit.png" /></div>--%>
<%--                <div class="ad2_2">编辑</div>--%>
<%--            </a>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--</div>--%>
<%--<div class="w100">--%>
<%--    <img src="/heatconfig/images/address/addressline.png" />--%>
<%--</div>--%>
<div class="kbox"></div>

<c:forEach items="${addressList}" var="address" varStatus="stat">
    <div class="addressbox" value="${address.id}">
        <div class="addressbox_1">
            <p class="p1">联系人：${address.contactPerson}<span>${fn:substring(address.phoneNum,0 ,3 )}********</span></p>
            <p class="p2">${address.district.districtName}&nbsp;${address.town.townName}&nbsp;${address.community.communityName}&nbsp;${address.particulas} </p>
        </div>
        <div class="addressbox_2">
            <div class="ad1" value="${address.userinfo.id}" >
                <div class="ad1_1" >
                    <c:if test="${address.defaultAdress==true}">
                        <div class="gwccheck on"></div>
                    </c:if>
                    <c:if test="${address.defaultAdress==false}">
                        <div class="gwccheck"></div>
                    </c:if>
                </div>
                <div class="ad1_2">设为默认</div>
            </div>
            <div class="ad2" >
                <div class="ad2_1"><img src="/heatconfig/images/address/del.png" /></div>
                <div class="ad2_2"   >删除</div>
            </div>
            <div class="ad2 mr">
<%--                <a href="addressEdit.html">--%>
<%--                    <div class="ad2_1"><img src="/heatconfig/images/address/edit.png" /></div>--%>
<%--                    <div class="ad2_2">编辑</div>--%>
<%--                </a>--%>
            </div>
        </div>
    </div>
    <c:if test="${address.defaultAdress==true}">
        <div class="w100">
            <img src="/heatconfig/images/address/addressline.png" />
        </div>
    </c:if>

    <div class="w100">

    </div>
    <div class="kbox"></div>
</c:forEach>

</body>
</html>
